import java.awt.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author zhaoqian
 * @create 2021/8/31 13:42
 */
public class shuzu {
    public static void main(String[] args) {        //这道题太难了
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            int n = in.nextInt();
            int sum = 0;
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }
            System.out.println(solution(n, arr));
            /*List<Integer> list3 = new ArrayList<Integer>();
            int total3=0;
            List<Integer> list5 = new ArrayList<Integer>();
            int total5=0;
            List<Integer> list = new ArrayList<Integer>();
            int other=0;
            int x=0;
            int y=0;
            for (int j=0;j<n;j++){
                if (arr[j]%3==0){
                    list3.add(arr[j]);
                    total3+=arr[j];
                }
                else if (arr[j]%5==0){
                    list5.add(arr[j]);
                    total5+=arr[j];
                }
                else {
                    list.add(arr[j]);
                    other+=arr[j];
                }
                sum+=  arr[j];
           }


            for (Integer intt : list2                ) {
                if (intt==total3-total5 ||intt==total5-total3){
                    System.out.println(true);
                    break;
                }else {
                    System.out.println(false);
                    break;
                }
            }*/

        }
    }

    private static boolean solution(int length, int[] nums) {
        int total = 0, total3 = 0, total5 = 0;
        List<Integer> list = new ArrayList<Integer>();
        for (int i = 0; i < length; i++) {
            total += nums[i];
            if (nums[i] % 5 == 0) {
                total5 += nums[i];
            } else if (nums[i] % 3 == 0) {
                total3 += nums[i];
            } else {
                list.add(nums[i]);
            }
        }
        if (total % 2 != 0)
            return false;
        if (list.size() == 0 && total3 == total5) {
            return true;
        } /*else if (list.size() != 0 && total3 == total5) {
            return false;
        } */else {
            List<Integer> list2 = new ArrayList<Integer>();
            list2.add(0);
            for (Integer otherNum : list) {
                List<Integer> list3 = new ArrayList<Integer>();
                for (Integer sum : list2) {
                    list3.add(otherNum + sum);
                    list3.add(otherNum - sum);
                }
                list2 = list3;
            }
            int temp = total3 - total5;
            for (Integer sum : list2) {
                if (sum == temp || sum == -temp) {
                    return true;
                }
            }
        }
        return false;
    }

}
